package com.chance.cc.crawler.prod.command.trigger.domain.news.acfun;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.acfun.searchKw.AcfunRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.acfun.searchKw.AcfunSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.acfun.searchKw.AcfunTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.acfun.searchKw.AcfunTraceTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;


public class AcfunCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {
    public static void main(String[] args) {
//        publishAcfunSearchKwRealtimeCrawlerScheduleTriggerInfo();
//        publishAcfunSearchKwTraceCrawlerScheduleTriggerInfo();
//        publishAcfunSearchKwTraceTraceCrawlerScheduleTriggerInfo();
        publishAcfunSearchKwSimpleCrawlerScheduleTriggerInfo();
    }

    public static void publishAcfunSearchKwRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = AcfunRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                AcfunRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/20 * * * ?",
                "acfun实时采集任务执行，每二十分钟执行一次"
        );
    }

    public static void publishAcfunSearchKwTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = AcfunTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                AcfunTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "acfun回溯采集任务执行，每一个小时执行一次"
        );
    }

    public static void publishAcfunSearchKwTraceTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = AcfunTraceTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                AcfunTraceTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 3 * * ?",
                "acfun回溯7天采集任务，每天凌晨3点执行"
        );
    }

    public static void publishAcfunSearchKwSimpleCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = AcfunSimpleCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                AcfunTraceTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "acfun临时补采任务"
        );
    }
}
